﻿using Furion.DependencyInjection;

using System;

namespace AdminAuthority.Attributes
{
    /// <summary>
    /// 授权菜单
    /// </summary>
    [SkipScan, AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple = true)]
    public sealed class AuthorityControllerAttribute : Attribute
    {
        /// <summary>
        /// 权限控制器
        /// </summary>
        /// <param name="typeCode">权限类型代码(Admin、API、API2)</param>
        /// <param name="controller">控制器</param>
        /// <param name="controllerDescription">控制器描述符</param>
        public AuthorityControllerAttribute(string typeCode = "", string controller = "", string controllerDescription = "")
        {
            this.TypeCode = typeCode;
            this.ControllerDescription = controllerDescription;
            this.Controller = controller;
        }

        /// <summary>
        /// 控制器
        /// </summary>
        public string Controller { get; }

        /// <summary>
        /// Controller 名称
        /// </summary>
        public string ControllerDescription { get; set; }

        /// <summary>
        /// 权限类型代码
        /// </summary>
        public string TypeCode { get; set; }
    }
}